package com.hairline.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Admin {
    private Integer id;

    private String username;

    private String password;

    private String lastLoginIp;

    private Date lastLoginTime;

    private String avatar;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date addTime;

    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private Boolean deleted;
    //String -> int[]
    //int[] -> Integer[] fl
    private Integer[] roleIds;

    public Admin(Integer id, String username, String avatar, Integer[] roleIds, String password){
        this.id = id;
        this.username = username;
        this.avatar = avatar;
        this.roleIds = roleIds;
        this.password = password;
    }
}